<#assign s=JspTaglibs["/WEB-INF/tld/struts-tags.tld"] />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<#import "/WEB-INF/tpl/public/DetailHead.ftl" as dHead> <@dHead.detailHead title="用户管理">
<link rel="stylesheet" type="text/css" href="${c}/css/${USER_SESSION.theme}/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" href="${c}/js/ztree/zTreeStyle.css" />
<script language="javascript" src="${c}/js/ui/i18n/grid.locale-cn.js"></script>
<script language="javascript" src="${c}/js/ui/jquery.jqGrid.min.js"></script>
<script language="javascript" src="${c}/js/ui/jquery.ui.accordion.min.js"></script>
<script language="javascript" src="${c}/js/ztree/jquery.ztree-2.6.min.js"></script>
<script language="javascript" src="${c}/js/core/base.js"></script>
<script language="javascript" src="${c}/js/core/department_tree.js"></script>
<script language="javascript" src="${c}/js/core/deptpermission_tree.js"></script>
<script language="javascript" src="${c}/js/oa/system/user-edit.js"></script>
</@dHead.detailHead>
<body>

<#import "/WEB-INF/tpl/public/DetailContent.ftl" as dc>
<@dc.detailContent title="用户设置">
<@s.form id="userForm" name="form1" action="saveUser.action" method="post">
<table align="center" width="100%">
	<tr>
		<td colspan="7" class="subtitle">用户信息</td>
		<@s.hidden name="edit" id="edit_flag" Class="required"/>
		<@s.hidden name="scopeString" id="scopeString"/>
	</tr>
	<tr>
		<td width="15%" class="label">用户编码(<font color="red">*</font>):</td>
		<td width="35%"><#if edit==false><@s.textfield name="user.user_code"
		id="user_code" maxlength="20"/>&nbsp;<span id="user_code_msg" style="color:red"></span>
		<#else><@s.textfield name="user.user_code" id="user_code" maxlength="20" readonly="true"/></#if></td>
		<td width="15%" class="label">密码:</td>
		<td><@s.password name="user.password" maxlength="16"/></td>
	</tr>
	<tr>
		<td width="15%" class="label">姓名(<font color="red">*</font>):</td>
		<td width="35%"><@s.textfield name="user.fullName" id="fullName" maxlength="20"/>&nbsp;<span id="fullName_msg" style="color:red"></span></td>
		<td width="15%" class="label">昵称:</td>
		<td><@s.textfield name="user.nickName" id="nickName" maxlength="20"/>&nbsp;<span id="nickName_msg" style="color:red"></span></td>
	</tr>
	<tr>
		<td width="15%" class="label">所属部门(<font color="red">*</font>):</td>
		<td width="35%"><@s.hidden name="user.department_code" id="department_code"/>
		<@s.textfield name="user.department_name" readonly="true" id="department_name" 
			maxlength="20" onclick="showMenu('department_name'); return false;" Class="required"/>
			&nbsp;<a id="menuBtn" href="#" onclick="showMenu('department_name'); return false;">选择</a>
		<span id="department_code_msg" style="color:red"></span></td>
		<td width="15%" class="label">联系电话:</td>
		<td><@s.textfield name="user.contact_phone" id="contact_phone" maxlength="20"/>&nbsp;<span id="contact_phone_msg" style="color:red"></span></td>
	</tr>
	<tr>
		<td width="15%" class="label">紧急联系人:</td>
		<td width="35%"><@s.textfield name="user.ect_person" id="ect_person" maxlength="20"/>&nbsp;<span id="ect_person_msg" style="color:red"></span></td>
		<td width="15%" class="label">紧急联系电:</td>
		<td><@s.textfield name="user.ect_phone" id="ect_phone" maxlength="20"/>&nbsp;<span id="ect_phone_msg" style="color:red"></span></td>
	</tr>
	<tr>
		<td width="15%" class="label">最后登录时间</td>
		<td width="35%"><#if user?exists&&user.login_time?exists>
		${user.login_time?string("yyyy-MM-dd HH:mm:ss")} </#if> <@s.property
		value="user.lastTime"/></td>
		<td width="15%" class="label">已冻结:</td>
		<td><#if user?exists&&user.freeze_flag?exists&&user.freeze_flag=='1'><input type="checkbox" name="user.freeze_flag" value='1' id='freeze_flag' checked="checked"/>
		<#else><input type="checkbox" name="user.freeze_flag" value='1' id='freeze_flag'/></#if></td>
	</tr>
	<tr><td colspan="7" class="subtitle">权限信息</td></tr>
	<tr>
		<td width="15%" class="label">岗位配置</td>
		<td colspan="3"><#if userpostList?exists><#list userpostList as post>
		<ul>
			<li style="width:200px; float:left;"><div style="width:100px;height:20px;float:left;text-align:right;padding-top:2px">${post.post_name}:</div>
			<#if post.user_post_id?exists><input name="postString" type="checkbox" value="${post.post_id}" checked="true"><#else><input name="postString" type="checkbox" value="${post.post_id}"></#if>
			</li>
		</ul>
		</#list></#if></td>
	</tr>
	<tr>
		<td width="15%" class="label">角色配置</td>
		<td colspan="3"><#if userroleList?exists><#list userroleList as role>
		<ul>
			<li style="width:200px; float:left;"><div style="width:100px;height:20px;float:left;text-align:right;padding-top:2px">${role.role_name}:</div>
			<#if role.user_role_id?exists><input name="roleString" type="checkbox" value="${role.role_id}" checked="true"><#else><input name="roleString" type="checkbox" value="${role.role_id}"></#if>
			</li>
		</ul>
		</#list></#if></td>
	</tr>
	<tr>
		<td width="15%" class="label">职能范围:</td>
		<td colspan="3">
			<div><ul id="dropdownDepartment" class="tree" style="height:200px;overflow-y:scroll;overflow-x:auto;"></ul></div>
		</td>
	</tr>
</table>
<div class="action" align="center">
<input type="button" value="保存" id="saveUserButt"/>&nbsp;&nbsp;
<input type="button" value="取消" onClick="window.close()"/>&nbsp;&nbsp;</div>
</@s.form>
</@dc.detailContent>
<div id="DropdownMenuBackground" style="display:none; position:absolute; height:200px; min-width:150px; background-color:white;border:1px solid;overflow-y:auto;overflow-x:auto;">
	<ul id="dropdownMenu" class="tree"></ul>
</div>
</body>
</html>